/*有效警情*/
var yxtjTemplate={
    data(){
        return{
            billData: [],
            pageSize:'15',
            show_if:false,
            moHu:''
        }
    },
    template:
        ` <div class="menuRightContent">
        <loading-biu v-show="show_if"></loading-biu>

      <div class="layui-form">
        <div class="layui-inline">
            <input class="form-control" type="text"  v-model="moHu" placeholder="请输条件...">
            <button type="button" id="btnEdit1" class="layui-btn" @click="cx" >查询数据</button>
        </div>
        <div>
         <!--第一个表格-->
        <table class="layui-table" id="tableExcel1">
            <thead>        
            <tr>
                <th>账单编号</th>
<!--                <th>一级分组</th>-->
<!--                <th>二级分组</th>-->
<!--                <th>三级分组</th>-->
<!--                <th>现有资产</th>-->
<!--                <th>支出</th>-->
<!--                <th>收入</th>              -->
<!--                <th>总资产</th>              -->
<!--                <th>简述</th>              -->
                <th>描述</th>              
                <th>年</th>              
                <th>月</th>              
                <th>日</th>              
                <th>添加时间</th>              
                <th>添加人</th>              
            </tr>
            </thead>
            <tr v-for="(item,index) in billData">
                <td>{{item.billNo}}</td>
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
<!--                <td>测试数据</td>-->
                <td>{{item.description}}</td>
                <td>{{item.year}}</td>
                <td>{{item.month}}</td>
                <td>{{item.day}}</td>
                <td>{{item.addTime}}</td>
                <td>{{item.userId}}</td>
            </tr>
            </tbody>
          </table>
        </div>
         <div class="sjzx-main-bottom">
             <div id="sjzx-page" class="sjzx-page"></div>
          </div>    
    </div>
      
  
</div>`,
    methods: {
        cx:function () {
            let that=this;
            let _this=this;
            queryBill(_this,1,_this.pageSize, _this.moHu);
        },
    },
    mounted: function () {
    },
    created:function () {

    }
}
function queryBill(obj,pageNum,pageSize,moHu) {
    axios.post(url+'bill/getAll',{pageNum:pageNum,pageSize:pageSize,moHu: moHu
        ,pageInfo:{"pageNum":pageNum, "pageSize":pageSize}
    })
        .then(function (infoResp) {
            let count=infoResp.data.data.total;
            obj.billData=infoResp.data.data.list;
            console.log("obj.billData")
            console.log(obj.billData)
            if(count>0){
                let _this=obj;
                laypage.render({
                    elem:'sjzx-page',
                    count:count,
                    limit:pageSize,
                    curr:pageNum ,
                    layout:['count','prev','page','next','refresh','skip'],
                    theme: '#5EB660',
                    jump:function (obj,first) {
                        if(!first){
                            queryBill(_this,obj.curr,_this.pageSize, _this.moHu)
                        }
                    }
                });
            }else {
                alert("没有数据")
            }
            count=0
        });
}

export default yxtjTemplate;